const mongoose = require("./db");

let listSchema = new mongoose.Schema({
  time: String,
  image: Array,
  addressObj: {
    name: String,
    address:String,
  },
  videolist:Array,
  title: String,
  content: String,
  user: {
    name: String,
    avatar: String,
  },
  like: {
    likes: String,
    ifLike: Boolean,
  },
  data: [
    {
      _id: String,
      name: String,
      content: String,
      img: String,
    },
  ],
});

let infoSchema = new mongoose.Schema({
  img:String,
  title:String,
  content:String,
  user:String,
  time:String,
  addr:String,
})


let listModel = mongoose.model("list", listSchema, "list");
let infoModel = mongoose.model("info",infoSchema,"info")
const AuctionOrders = mongoose.model(
  "AuctionOrders",
  {
    imageSrc: String,
    title: String,
    Ordertype: String,
    price: Number,
    tabTitle: String,
  },
  "AuctionOrders"
); //约拍订单

//套餐列表
let taocanSchema=mongoose.Schema({
    title:String,
    price:Number,
    jian:Number,
    src:String  
})
let taocanModel=mongoose.model("taocan",taocanSchema,"taocan")
//以下为为他人购买的用户信息，不是登录的用户信息！！！
let userlistShcema=mongoose.Schema({
    name:String,
    sex:String,
    birthday:String,
    phone:String
})

let userlistModel=mongoose.model("userlist",userlistShcema,"userlist")


module.exports = { listModel, AuctionOrders,infoModel,taocanModel,userlistModel};
